//
//  FANEmoticon.swift
//  Weibo - Swift
//
//  Created by user on 16/4/26.
//  Copyright © 2016年 user. All rights reserved.
//

import UIKit

class FANEmoticon: NSObject,NSCoding {
    
    var chs:String?
    
    var code:String?
    
    var type:String?

    var png:String?

    var folderName:String?

    
    init(dict:[String:AnyObject]) {
        
        super.init()
        
        setValuesForKeysWithDictionary(dict)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {}
    
    func encodeWithCoder(encoder: NSCoder){
        
        encoder.encodeObject(chs, forKey: "chs")
        encoder.encodeObject(code, forKey: "code")
        encoder.encodeObject(type, forKey: "type")
        encoder.encodeObject(png, forKey: "png")
        encoder.encodeObject(folderName, forKey: "folderName")

    }
    
    required init?(coder decoder: NSCoder){
        
        chs = decoder.decodeObjectForKey("chs") as? String
        code = decoder.decodeObjectForKey("code") as? String
        type = decoder.decodeObjectForKey("type") as? String
        png = decoder.decodeObjectForKey("png") as? String
        folderName = decoder.decodeObjectForKey("folderName") as? String
        
    }

}
